package com.ruoyi.production.service.impl.stroma;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.stroma.StromaKindMapper;
import com.ruoyi.production.domain.stroma.StromaKind;
import com.ruoyi.production.service.stroma.IStromaKindService;

/**
 * 基质种Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class StromaKindServiceImpl implements IStromaKindService
{
    @Autowired
    private StromaKindMapper stromaKindMapper;

    /**
     * 查询基质种
     *
     * @param stromaKindId 基质种ID
     * @return 基质种
     */
    @Override
    public StromaKind selectStromaKindById(Long stromaKindId)
    {
        return stromaKindMapper.selectStromaKindById(stromaKindId);
    }

    /**
     * 查询基质种列表
     *
     * @param stromaKind 基质种
     * @return 基质种
     */
    @Override
    public List<StromaKind> selectStromaKindList(StromaKind stromaKind)
    {
        return stromaKindMapper.selectStromaKindList(stromaKind);
    }

    /**
     * 新增基质种
     *
     * @param stromaKind 基质种
     * @return 结果
     */
    @Override
    public int insertStromaKind(StromaKind stromaKind)
    {
        stromaKind.setCreateTime(DateUtils.getNowDate());
        return stromaKindMapper.insertStromaKind(stromaKind);
    }

    /**
     * 修改基质种
     *
     * @param stromaKind 基质种
     * @return 结果
     */
    @Override
    public int updateStromaKind(StromaKind stromaKind)
    {
        stromaKind.setUpdateTime(DateUtils.getNowDate());
        return stromaKindMapper.updateStromaKind(stromaKind);
    }

    /**
     * 批量删除基质种
     *
     * @param stromaKindIds 需要删除的基质种ID
     * @return 结果
     */
    @Override
    public int deleteStromaKindByIds(Long[] stromaKindIds)
    {
        return stromaKindMapper.deleteStromaKindByIds(stromaKindIds);
    }

    /**
     * 删除基质种信息
     *
     * @param stromaKindId 基质种ID
     * @return 结果
     */
    @Override
    public int deleteStromaKindById(Long stromaKindId)
    {
        return stromaKindMapper.deleteStromaKindById(stromaKindId);
    }
}
